//
//@File    :	14.7_Worker0.h
//@Time    :	2022/01/20 14:40:16
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	working classes
//

#ifndef WORKER0_H_
#define WORKER0_H_

#include <string>

class Worker
{
private:
    std::string fullname;
    long id;

public:
    Worker() : fullname("no one"), id(0L) {}
    Worker(const std::string &s, long n) : fullname(s), id(n) {}
    virtual ~Worker() = 0; //pure virtual detructor
    virtual void Set();
    virtual void Show() const;
};

class Waiter : public Worker
{
private:
    int panache;

public:
    Waiter() : Worker(), panache(0) {}
    Waiter(const std::string &s, long n, int p = 0) : Worker(s, n), panache(p) {}
    Waiter(const Worker &wk, int p = 0) : Worker(wk), panache(p) {}
    void Set();
    void Show() const;
};

class Singer : public Worker
{

protected:
    //一个枚举等用符号常量alto等表示声音类型
    enum
    {
        other,
        alto,
        contralto,
        soprano,
        bass,
        baritone,
        tenor
    };
    enum
    {
        Vtypes = 7
    };

private:
    //使用静态数组pv存储指向C-风格字符串的指针
    //Vtypes的使用要放在上面定义之后
    static char *pv[Vtypes];
    int voice;

public:
    Singer() : Worker(), voice(other) {}
    Singer(const std::string &s, long n, int v = other) : Worker(s, n), voice(v) {}
    Singer(const Worker &wk, int v = other) : Worker(wk), voice(v) {}
    void Set();
    void Show() const;
};
#endif // WORKER0_H_